# test_image_path = 'F:\\tran\\contract\\01.南国土出让字\\1993年\\南国土让字[1993]01号\\SKMBT_C25208031209250.jpg'
    # test_image_path = 'E:/page_1.jpg'
    # recognize_words_by_paddleocr.recognize_words_by_paddleocr(test_image_path)
    # recognize_words_by_pytesseract.recognize_words_by_pytesseract(test_image_path)


def ocr_extract_text_by_regular_expression(self, image_path):
    ocr = PaddleOCR(use_angle_cls=True, lang="ch")

    result = ocr.ocr(image_path, cls=True)

    address_pattern = r"*州*南*房|室*"

    for idx in range(len(result)):
        res = result[idx]
        print(f"提取的信息为：{res}")
        for line in res:
            target = line[1][0]
            # 检查一个变量是否是特定类型通常使用 isinstance() 函数
            if isinstance(target, str):
                # matches = re.findall(address_pattern, target)
                # if matches:
                #     print(f"地址是：{matches}")
                #     return matches
                if target.__contains__('市'):
                    return target